package com.lib.repository;

import com.lib.model.VerifyCode;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.time.LocalDate;
import java.util.List;
import java.util.Optional;

/**
 * Created by ethan-liu on 2017/5/25.
 */
public interface VerifyCodeRepository extends PagingAndSortingRepository<VerifyCode, Long> {
    List<VerifyCode> findByCellPhoneNumAndSendDate(String cellPhoneNum, LocalDate sendDate);
    Optional<VerifyCode> findByCellPhoneNumAndVerifyCodeAndUsedFalse(String cellPhoneNum, String verifyCode);
}
